<?php 
/*
# ------------------------------------------------------------------------
# JD Base Theme
# ------------------------------------------------------------------------
# Copyright (C) 2004-2009 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
# @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
# Author: J.O.O.M Solutions Co., Ltd
# Websites: http://www.joomlart.com - http://www.joomlancers.com
# ------------------------------------------------------------------------
*/
$T3Profile =& T3Profile::getInstance(); 
$T3Cpanel =& T3Cpanel::getInstance();
$T3Params =& T3Params::getInstance();
global $theme_key;
?>
<?php if (!$T3Params->get ('option_layouts') && !$T3Params->get ('option_screen') && !$T3Params->get ('option_font') && !$T3Params->get ('option_themes') && !$T3Params->get ('option_profiles') && !$T3Params->get ('option_menu')) return ; ?>
<div id="ja-cpanel-wrapper">
<div id="ja-cpanel">
  <div id="ja-cpanel-main">
    <div class="ja-cpanel-head clearfix">
			<a href="http://wiki.joomlart.com/wiki/JD_T3_Framework/Overview" class="first" title="About T3"><span>About</span></a>
			<a href="http://wiki.joomlart.com/wiki/JD_T3_Framework/Guides" title="Guides"><span>Guides</span></a>
			<a href="http://wiki.joomlart.com/wiki/JD_T3_Framework/FAQs" title="FAQs"><span>FAQs</span></a>
		</div>
		<div class="ja-cpanel-tools clearfix">
		<?php if ($T3Params->get ('option_font')) : ?> 
			<?php include('font.php') ?>
		<?php endif;?>
		<?php if ($T3Params->get ('option_screen')) : ?> 
			<?php include('screen.php') ?>
		<?php endif;?>
		<?php if ($T3Params->get ('option_profiles')) : ?> 
			<?php include('profiles.php') ?>
		<?php endif;?>
		<?php if ($T3Params->get ('option_layouts')) : ?> 
			<?php include('layouts.php') ?>
		<?php endif;?>
		<?php if ($T3Params->get ('option_direction')) : ?> 
			<?php include('direction.php') ?>
		<?php endif;?>
		<?php if ($T3Params->get ('option_menu')) : ?> 
			<?php include('menu.php') ?>
		<?php endif;?>
		</div>
		<div class="ja-cpanel-action">
			<a href="#" class="form-submit" onclick="cpanel_apply();return false;" title="Apply setting"><span>Apply</span></a>
			<a href="#" onclick="cpanel_reset();return false;" title="Reset to default setting"><span>Reset</span></a>
		</div>
	</div>
	<a href="#" id="ja-cpanel-toggle"><span>Cpanel</span></a>
</div>
</div>

<script type="text/javascript">

var tmpl_name = '<?php
echo $theme_key?>';
 jQuery(document).ready(function(){ 
	 var main = jQuery ('#ja-cpanel-main');
	 var height = main.height();
	 if(height <= 200)height=700; //fix for Chrome when using RTL (don't know why :D)
	 main.css('position','absolute');
	 main.css('right',0);	
	 main.css('top',-height-10+'px');	
	 var toggle = jQuery ('#ja-cpanel-toggle');
	jQuery ('#ja-cpanel').css ('top', 0);
	var jd_cpanel_status = 'close';
	var quickmenu = jQuery('.jd-admin-menu-caption');
	toggle.addClass ('close');
	toggle.click (function () {
		if (jd_cpanel_status == 'close') {
			jd_cpanel_status = 'open';
			if(jQuery('a',quickmenu).hasClass('open')){
				quickmenu.click();
				}
			main.stop(true,false).animate({top:0},500,function(){
				toggle.removeClass('close').addClass('open')
				});			
		} else {
			jd_cpanel_status = 'close';
			main.stop(true,false).animate({top: -height-10+'px'},700, function(){
				toggle.removeClass('open').addClass('close');
				});	
			}
		return false;
	});
 });

</script>
